#include "stdio.h"
#include <stdio.h>
#include <string.h>
#include <unistd.h>

int main()
{
    mFILE* fp = myopen("log.txt","a");
    if(fp == NULL)
    {
      return 1;
    }
    char str[64];
    int cnt = 10;
    while(cnt)
    {
        printf("write %d\n",cnt);
        snprintf(str,sizeof(str),"hello Linux %d",cnt);
        cnt--;
        mywrite(str,strlen(str),fp);
        //myfflush(fp);
        sleep(1);
    }
    
    myclose(fp);
}
